﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using BEPUphysics.Entities;
using BEPUphysics.Entities.Prefabs;

namespace The_LarX
{
    public class BepuEntity_Box : BepuEntity
    {
        public float Width
        {
            get 
            {
                Box Box = (Box)Entity;
                return Box.Width; 
            }
            set
            {
                Box Box = (Box)Entity;
                Box.Width = value;
            }
        }
        public float Height
        {
            get
            {
                Box Box = (Box)Entity;
                return Box.Height;
            }
            set
            {
                Box Box = (Box)Entity;
                Box.Height = value;
            }
        }
        public float Length
        {
            get 
            {
                Box Box = (Box)Entity;
                return Box.Length; 
            }
            set
            {
                Box Box = (Box)Entity;
                Box.Length = value;
            }
        }

        public override Vector3 Scale
        {
            get
            {
                return new Vector3(Width, Height, Length);
            }
            set
            {
                Width = value.X;
                Height = value.Y;
                Length = value.Z;
                if (Vector3Util.Average(value) == 1)
                {
                }
            }
        }

        public BepuEntity_Box()
            : base()
        {
            this.Entity = new Box(Vector3.Zero, 1, 1, 1, 5);
            BepuPhysics.ActualBepuPhysics.Space.Add(this.Entity);
            this.Immovable = false;
            this.Mass = 1;
            this.Entity.Tag = this;           
        }                
    }
}
